﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Class="ProModelWindows.Silverlight.AST.Demo.MainDemoPage"
	d:DesignWidth="640" d:DesignHeight="480" Width="1000" Height="650" xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" Loaded="UserControl_Loaded">

	<UserControl.Resources>
        <LinearGradientBrush x:Key="ModalBrush1" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFB4BABE"/>
            <GradientStop Color="#FFB7CDDE" Offset="0.984"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="ModalBrush2" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFDDE2D5"/>
            <GradientStop Color="#FFB7C2A1" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="Brush1" EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="#FF567395"/>
			<GradientStop Color="#FF193352" Offset="1"/>
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="ModalHeaderBrush1" EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="#FF629EC6"/>
			<GradientStop Color="#FF205070" Offset="0.984"/>
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="ModalHeaderBrush2" EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="#FFB7C2A1"/>
			<GradientStop Color="#FF637C33" Offset="1"/>
		</LinearGradientBrush>
	</UserControl.Resources>
	<UserControl.Background>
		<StaticResource ResourceKey="ModalHeaderBrush1"/>
	</UserControl.Background>
	<!--<UserControl.Foreground>
		<StaticResource ResourceKey="ModalBrush2"/>
	</UserControl.Foreground>-->

	<Grid x:Name="LayoutRoot" Background="{StaticResource Brush1}">
		<basics:TabControl Margin="8,8,8,73" x:Name="_tcTabs">
			<basics:TabItem x:Name="_tpWndResize" Header="Windowed">
				<Grid>
					<ScrollViewer Width="971">
						<TextBlock Height="Auto" Width="Auto" TextWrapping="Wrap"><Run Foreground="#FFB6B6B6" Text="using System;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Controls;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Documents;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Ink;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Input;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Media;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Media.Animation;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Shapes;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using Microsoft.Windows.Controls.Theming;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using ProModel.ApplicationFramework.Silverlight;"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="namespace ProModelWindows.Silverlight.AST.Demo"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="{}{"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;public partial class MainDemoPage : UserControl"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;{"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;public MainDemoPage()"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;{"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;&#x9;// Required to initialize variables"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;&#x9;InitializeComponent();"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;}"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        private void UserControl_Loaded(object sender, RoutedEventArgs e)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            string themeToLoad = @&quot;Themes/Microsoft.Windows.Controls.Theming.ExpressionDark.xaml&quot;;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            SetTheme(LayoutRoot as FrameworkElement, themeToLoad);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        public static void SetTheme(FrameworkElement control, string theme)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            Uri uri = new Uri(@&quot;ProModelWindows.Silverlight.AST.Demo;component/&quot; + theme, UriKind.Relative);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            ImplicitStyleManager.SetResourceDictionaryUri(control, uri);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            ImplicitStyleManager.SetApplyMode(control, ImplicitStylesApplyMode.Auto);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            ImplicitStyleManager.Apply(control);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        private void _btnShowWindow_Click(object sender, RoutedEventArgs e)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            if (_tcTabs.SelectedItem == _tpWndResize)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="                ShowWindowedModal(OnDialogClosed, LayoutRoot);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            }"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            else if (_tcTabs.SelectedItem == _tpWndNoResize)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="                ShowWindowedModalNoResize(OnDialogClosed, LayoutRoot);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            }"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            else"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="                ShowModal(OnDialogClosed, LayoutRoot);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            }"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        #region Modal Handling"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        public void ShowModal(DialogClose callback, Panel panel)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            bool useCanvasPainting = true;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            ModalControl wmc = new ModalControl(new DialogClose(OnDialogClosed));"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            TestUserControl tc = new TestUserControl();"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.HostedControl = tc;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.ShowModal(panel, useCanvasPainting, new Size(tc.MinWidth, tc.MinHeight));"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFFD0505" Text="        public void ShowWindowedModal(DialogClose callback, Panel panel)"/><LineBreak/><Run Foreground="#FFFD0505" Text="        {"/><LineBreak/><Run Foreground="#FFFD0505" Text="            bool useCanvasPainting = true;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            WindowedModalControl wmc = new WindowedModalControl(callback, MsgBoxButtons.OKCancelApply);"/><LineBreak/><Run Foreground="#FFFD0505" Text="            TestUserControl tc = new TestUserControl();"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.TitleBarBrush = Resources[&quot;ModalHeaderBrush1&quot;] as Brush;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.FormBackgroundBrush = Resources[&quot;ModalBrush1&quot;] as Brush;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.HostedControl = tc;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.ShowModal(panel, useCanvasPainting, new Size(tc.MinWidth, tc.MinHeight));"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.AllowResizing = true;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.AllowMaximize = true;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.TitleBarText = &quot;It's a Working Title...and it truncates if need be&quot;;"/><LineBreak/><Run Foreground="#FFFD0505" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        public void ShowWindowedModalNoResize(DialogClose callback, Panel panel)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            bool useCanvasPainting = true;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            WindowedModalControl wmc = new WindowedModalControl(callback, MsgBoxButtons.OKCancel);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            TestUserControl tc = new TestUserControl();"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.TitleBarBrush = Resources[&quot;ModalHeaderBrush2&quot;] as Brush;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.FormBackgroundBrush = Resources[&quot;ModalBrush2&quot;] as Brush;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.HostedControl = tc;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.ShowModal(panel, useCanvasPainting, new Size(tc.MinWidth, tc.MinHeight));"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.AllowResizing = false;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.AllowMaximize = false;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.TitleBarText = &quot;This can't be resized&quot;;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        bool OnDialogClosed(object sender, DialogExit e)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            _tbResult.Text = &quot;Dialog Result: &quot; + e.ToString();"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            return true;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        #endregion"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="    }"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="}"/></TextBlock>
					</ScrollViewer>
				</Grid>
			</basics:TabItem>
			<basics:TabItem x:Name="_tpWndNoResize" Header="Windowed (No Resize)">
				<Grid>
					<ScrollViewer Width="973">
						<TextBlock Height="Auto" Width="Auto" TextWrapping="Wrap"><Run Foreground="#FFB6B6B6" Text="using System;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Controls;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Documents;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Ink;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Input;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Media;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Media.Animation;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Shapes;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using Microsoft.Windows.Controls.Theming;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using ProModel.ApplicationFramework.Silverlight;"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="namespace ProModelWindows.Silverlight.AST.Demo"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="{}{"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;public partial class MainDemoPage : UserControl"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;{"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;public MainDemoPage()"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;{"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;&#x9;// Required to initialize variables"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;&#x9;InitializeComponent();"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;}"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        private void UserControl_Loaded(object sender, RoutedEventArgs e)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            string themeToLoad = @&quot;Themes/Microsoft.Windows.Controls.Theming.ExpressionDark.xaml&quot;;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            SetTheme(LayoutRoot as FrameworkElement, themeToLoad);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        public static void SetTheme(FrameworkElement control, string theme)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            Uri uri = new Uri(@&quot;ProModelWindows.Silverlight.AST.Demo;component/&quot; + theme, UriKind.Relative);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            ImplicitStyleManager.SetResourceDictionaryUri(control, uri);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            ImplicitStyleManager.SetApplyMode(control, ImplicitStylesApplyMode.Auto);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            ImplicitStyleManager.Apply(control);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        private void _btnShowWindow_Click(object sender, RoutedEventArgs e)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            if (_tcTabs.SelectedItem == _tpWndResize)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="                ShowWindowedModal(OnDialogClosed, LayoutRoot);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            }"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            else if (_tcTabs.SelectedItem == _tpWndNoResize)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="                ShowWindowedModalNoResize(OnDialogClosed, LayoutRoot);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            }"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            else"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="                ShowModal(OnDialogClosed, LayoutRoot);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            }"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        #region Modal Handling"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        public void ShowModal(DialogClose callback, Panel panel)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            bool useCanvasPainting = true;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            ModalControl wmc = new ModalControl(new DialogClose(OnDialogClosed));"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            TestUserControl tc = new TestUserControl();"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.HostedControl = tc;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.ShowModal(panel, useCanvasPainting, new Size(tc.MinWidth, tc.MinHeight));"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        public void ShowWindowedModal(DialogClose callback, Panel panel)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            bool useCanvasPainting = true;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            WindowedModalControl wmc = new WindowedModalControl(callback, MsgBoxButtons.OKCancelApply);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            TestUserControl tc = new TestUserControl();"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.TitleBarBrush = Resources[&quot;ModalHeaderBrush1&quot;] as Brush;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.FormBackgroundBrush = Resources[&quot;ModalBrush1&quot;] as Brush;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.HostedControl = tc;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.ShowModal(panel, useCanvasPainting, new Size(tc.MinWidth, tc.MinHeight));"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.AllowResizing = true;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.AllowMaximize = true;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.TitleBarText = &quot;It's a Working Title...and it truncates if need be&quot;;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFFD0505" Text="        public void ShowWindowedModalNoResize(DialogClose callback, Panel panel)"/><LineBreak/><Run Foreground="#FFFD0505" Text="        {"/><LineBreak/><Run Foreground="#FFFD0505" Text="            bool useCanvasPainting = true;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            WindowedModalControl wmc = new WindowedModalControl(callback, MsgBoxButtons.OKCancel);"/><LineBreak/><Run Foreground="#FFFD0505" Text="            TestUserControl tc = new TestUserControl();"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.TitleBarBrush = Resources[&quot;ModalHeaderBrush2&quot;] as Brush;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.FormBackgroundBrush = Resources[&quot;ModalBrush2&quot;] as Brush;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.HostedControl = tc;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.ShowModal(panel, useCanvasPainting, new Size(tc.MinWidth, tc.MinHeight));"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.AllowResizing = false;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.AllowMaximize = false;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.TitleBarText = &quot;This can't be resized&quot;;"/><LineBreak/><Run Foreground="#FFFD0505" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        bool OnDialogClosed(object sender, DialogExit e)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            _tbResult.Text = &quot;Dialog Result: &quot; + e.ToString();"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            return true;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        #endregion"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="    }"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="}"/></TextBlock>
					</ScrollViewer>
				</Grid>
			</basics:TabItem>
			<basics:TabItem Header="Pure Modal" x:Name="_tpModal">
				<Grid>
					<ScrollViewer Width="973">
						<TextBlock Height="Auto" Width="Auto" TextWrapping="Wrap"><Run Foreground="#FFB6B6B6" Text="using System;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Controls;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Documents;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Ink;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Input;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Media;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Media.Animation;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using System.Windows.Shapes;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using Microsoft.Windows.Controls.Theming;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="using ProModel.ApplicationFramework.Silverlight;"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="namespace ProModelWindows.Silverlight.AST.Demo"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="{}{"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;public partial class MainDemoPage : UserControl"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;{"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;public MainDemoPage()"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;{"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;&#x9;// Required to initialize variables"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;&#x9;InitializeComponent();"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="&#x9;&#x9;}"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        private void UserControl_Loaded(object sender, RoutedEventArgs e)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            string themeToLoad = @&quot;Themes/Microsoft.Windows.Controls.Theming.ExpressionDark.xaml&quot;;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            SetTheme(LayoutRoot as FrameworkElement, themeToLoad);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        public static void SetTheme(FrameworkElement control, string theme)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            Uri uri = new Uri(@&quot;ProModelWindows.Silverlight.AST.Demo;component/&quot; + theme, UriKind.Relative);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            ImplicitStyleManager.SetResourceDictionaryUri(control, uri);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            ImplicitStyleManager.SetApplyMode(control, ImplicitStylesApplyMode.Auto);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            ImplicitStyleManager.Apply(control);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        private void _btnShowWindow_Click(object sender, RoutedEventArgs e)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            if (_tcTabs.SelectedItem == _tpWndResize)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="                ShowWindowedModal(OnDialogClosed, LayoutRoot);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            }"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            else if (_tcTabs.SelectedItem == _tpWndNoResize)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="                ShowWindowedModalNoResize(OnDialogClosed, LayoutRoot);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            }"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            else"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="                ShowModal(OnDialogClosed, LayoutRoot);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            }"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        #region Modal Handling"/><LineBreak/><LineBreak/><Run Foreground="#FFFD0505" Text="        public void ShowModal(DialogClose callback, Panel panel)"/><LineBreak/><Run Foreground="#FFFD0505" Text="        {"/><LineBreak/><Run Foreground="#FFFD0505" Text="            bool useCanvasPainting = true;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            ModalControl wmc = new ModalControl(new DialogClose(OnDialogClosed));"/><LineBreak/><Run Foreground="#FFFD0505" Text="            TestUserControl tc = new TestUserControl();"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.HostedControl = tc;"/><LineBreak/><Run Foreground="#FFFD0505" Text="            wmc.ShowModal(panel, useCanvasPainting, new Size(tc.MinWidth, tc.MinHeight));"/><LineBreak/><Run Foreground="#FFFD0505" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        public void ShowWindowedModal(DialogClose callback, Panel panel)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            bool useCanvasPainting = true;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            WindowedModalControl wmc = new WindowedModalControl(callback, MsgBoxButtons.OKCancelApply);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            TestUserControl tc = new TestUserControl();"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.TitleBarBrush = Resources[&quot;ModalHeaderBrush1&quot;] as Brush;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.FormBackgroundBrush = Resources[&quot;ModalBrush1&quot;] as Brush;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.HostedControl = tc;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.ShowModal(panel, useCanvasPainting, new Size(tc.MinWidth, tc.MinHeight));"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.AllowResizing = true;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.AllowMaximize = true;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.TitleBarText = &quot;It's a Working Title...and it truncates if need be&quot;;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        public void ShowWindowedModalNoResize(DialogClose callback, Panel panel)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            bool useCanvasPainting = true;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            WindowedModalControl wmc = new WindowedModalControl(callback, MsgBoxButtons.OKCancel);"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            TestUserControl tc = new TestUserControl();"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.TitleBarBrush = Resources[&quot;ModalHeaderBrush2&quot;] as Brush;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.FormBackgroundBrush = Resources[&quot;ModalBrush2&quot;] as Brush;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.HostedControl = tc;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.ShowModal(panel, useCanvasPainting, new Size(tc.MinWidth, tc.MinHeight));"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.AllowResizing = false;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.AllowMaximize = false;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            wmc.TitleBarText = &quot;This can't be resized&quot;;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        bool OnDialogClosed(object sender, DialogExit e)"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        {"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            _tbResult.Text = &quot;Dialog Result: &quot; + e.ToString();"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="            return true;"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        }"/><LineBreak/><LineBreak/><Run Foreground="#FFB6B6B6" Text="        #endregion"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="    }"/><LineBreak/><Run Foreground="#FFB6B6B6" Text="}"/></TextBlock>
					</ScrollViewer>
				</Grid>
			</basics:TabItem>
		</basics:TabControl>
		<Border Height="61" Margin="8,0,8,8" VerticalAlignment="Bottom" CornerRadius="4,5,10,10" Background="{StaticResource Brush1}" BorderBrush="#FFC6C6C6" BorderThickness="1,1,1,1">
			<Button Height="31" Width="132" Content="Show Window" HorizontalAlignment="Left" Margin="5,0,0,0" x:Name="_btnShowWindow" Click="_btnShowWindow_Click"/>
		</Border>
		<TextBlock Height="43" Margin="160,0,310,11" x:Name="_tbResult" VerticalAlignment="Bottom" TextWrapping="Wrap" FontSize="22" TextAlignment="Left" Foreground="#FFCFCFCF"><Run FontSize="24" Foreground="#FFBCBCBC" Text=""/></TextBlock>
		<Path Stretch="Fill" StrokeLineJoin="Round" Stroke="{x:Null}" Fill="#7FF70E04" Data="F1 M357.76868,208.30193 L355,119.333 L267,119.333 L269.76868,208.30193 L357.76868,208.30193 z" Height="30.33" Width="30.944" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,39.056,28.67" Opacity="0.5">
			<Path.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform Angle="-19.288"/>
					<TranslateTransform Y="-0.16517519083909349" X="-0.028064131849466989"/>
				</TransformGroup>
			</Path.RenderTransform>
		</Path>
		<Path Stretch="Fill" StrokeLineJoin="Round" Stroke="{x:Null}" Fill="#4C52E812" Data="F1 M 355,207.333L 355,119.333L 267,119.333L 267,207.333L 355,207.333 Z " Height="23.539" HorizontalAlignment="Right" Margin="0,0,18.583,35.283" VerticalAlignment="Bottom" Width="21.984" RenderTransformOrigin="0.5,0.5" d:LayoutOverrides="Width, Height" Opacity="0.5">
			<Path.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform Angle="22.567"/>
					<TranslateTransform/>
				</TransformGroup>
			</Path.RenderTransform>
		</Path>
		<Path Stretch="Fill" StrokeLineJoin="Round" Stroke="{x:Null}" Fill="#7F12E8D3" Data="F1 M 355,207.333L 355,119.333L 267,119.333L 267,207.333L 355,207.333 Z " Height="21.275" HorizontalAlignment="Right" Margin="0,0,29.719,20" VerticalAlignment="Bottom" Width="21.275" RenderTransformOrigin="0.5,0.5" Opacity="0.5">
			<Path.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform Angle="12.662"/>
					<TranslateTransform/>
				</TransformGroup>
			</Path.RenderTransform>
		</Path>
		<Path Stretch="Fill" StrokeLineJoin="Round" Stroke="{x:Null}" Fill="#7FF71904" Data="F1 M357.76868,208.30193 L355,119.333 L267,119.333 L269.76868,208.30193 L357.76868,208.30193 z" RenderTransformOrigin="0.5,0.5" Height="11.711" HorizontalAlignment="Right" Margin="0,12.953,23.844,0" VerticalAlignment="Top" Width="11.948" d:LayoutOverrides="Width, Height" Opacity="0.5">
			<Path.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform Angle="-19.288"/>
					<TranslateTransform X="-0.028064131849466989" Y="-0.16517519083909349"/>
				</TransformGroup>
			</Path.RenderTransform>
		</Path>
		<Path Stretch="Fill" StrokeLineJoin="Round" Stroke="{x:Null}" Fill="#4C52E812" Data="F1 M 355,207.333L 355,119.333L 267,119.333L 267,207.333L 355,207.333 Z " Height="9.09" HorizontalAlignment="Right" Margin="0,12.88,15.854,0" VerticalAlignment="Top" Width="8.489" RenderTransformOrigin="0.5,0.5" d:LayoutOverrides="Width, Height" Opacity="0.5">
			<Path.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform Angle="22.567"/>
					<TranslateTransform/>
				</TransformGroup>
			</Path.RenderTransform>
		</Path>
		<Path Stretch="Fill" StrokeLineJoin="Round" Stroke="{x:Null}" Fill="#7F12E8D3" Data="F1 M 355,207.333L 355,119.333L 267,119.333L 267,207.333L 355,207.333 Z " HorizontalAlignment="Right" Margin="0,19.949,19.864,0" Width="8.215" RenderTransformOrigin="0.5,0.5" Height="8.215" VerticalAlignment="Top" d:LayoutOverrides="Width, Height" Opacity="0.5">
			<Path.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform Angle="12.662"/>
					<TranslateTransform/>
				</TransformGroup>
			</Path.RenderTransform>
		</Path>
	</Grid>
</UserControl>